package nix.demo1.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import nix.demo1.domain.User;
import nix.demo1.service.UserService;

public class UserServlet extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		UserService userService = new UserService();
		User user = userService.find();

		request.setAttribute("user", user);

		request.getRequestDispatcher("/demo1/showUser.jsp").forward(request, response);
		return;
	}
}
